package edu.fim.presentation.view;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.WindowConstants;


public abstract class AbstractForm extends JFrame implements Form {

	private static final long serialVersionUID = -8429118908445700504L;

	public AbstractForm(String title) {
		setTitle(title);
	}

	public void initialize() {
		setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
		initializeDynamicComponents();
		buildLayout();
	}

	public void showMessage(String mensagem) {
		JOptionPane.showMessageDialog(this, mensagem);
	}

	protected abstract void initializeDynamicComponents();

	protected abstract void buildLayout();
}